<?php
/**
 * Created by PhpStorm.
 * User: sunwu
 * Date: 2018/2/6
 * Time: 9:17
 */

namespace app\home\model;
class Comment extends Base{
    protected $pk='PK_CommentGuid';
    protected $table='rs_comment';
    public function user() {
        return $this->belongsTo('user', 'FK_UserGuid', 'PK_UserGuid'); //关联模型名，外键名，关联模型的主键
    }

    public function resource()
    {
        return $this->hasOne('resource','PK_ResourceGuid','FK_ResourceGuid');
    }
}